import java.util.HashMap;

public class SymbolTable {
    HashMap<String,Pairs> tableMap;
    private String type;    //circle simple void int
    private String dataType;    //void int
    private int whileIndex;

    public SymbolTable() {
        this.tableMap = new HashMap<>();
        this.type = "simple";
    }

    public boolean containsPair(String name) {
        return tableMap.containsKey(name);
    }

    public HashMap<String,Pairs> getTableMap() {
        return this.tableMap;
    }

    public void addPair(Pairs pairs) {
        this.tableMap.put(pairs.getToken(),pairs);
    }

    public void setType(String type){
        this.type = type;
    }

    public boolean isCircle(){
        return type.equals("circle");
    }

    public boolean isVoid() {
        return type.equals("void");
    }

    public boolean isInt() {
        return type.equals("int");
    }

    public boolean isSimple() {
        return type.equals("simple");
    }

    public String getType() {
        return type;
    }

    public int getWhileIndex() {
        return this.whileIndex;
    }

    public void setWhileIndex(int index) {
        this.whileIndex = index;
    }
}
